#ifndef BSP_MOTOR_H
#define BSP_MOTOR_H

#include "header_index.h"

#define MOTOR1_LEFT_PIN GPIO_PIN_6
#define MOTOR1_LEFT_PIN_PORT GPIOA
#define MOTOR1_RIGHT_PIN GPIO_PIN_7
#define MOTOR1_RIGHT_PIN_PORT GPIOA

#define MOTOR2_LEFT_PIN GPIO_PIN_1
#define MOTOR2_LEFT_PIN_PORT GPIOB
#define MOTOR2_RIGHT_PIN GPIO_PIN_0
#define MOTOR2_RIGHT_PIN_PORT GPIOB



typedef struct
{
    uint16_t left_pin;
    uint16_t right_pin;
    GPIO_TypeDef*  left_pin_port;
    GPIO_TypeDef*  right_pin_port;
}Motor_t;//电机结构体




void Motor_Init(void);
void Motor_Sleep(Motor_t *M1, Motor_t *M2);
void Motor_Ahead(Motor_t *M1, Motor_t *M2);
void Motor_Stop(Motor_t *M1, Motor_t *M2);
void Motor_Back(Motor_t *M1, Motor_t *M2);
void Motor_Turn_Left(Motor_t *M1, Motor_t *M2);
void Motor_Turn_Right(Motor_t *M1, Motor_t *M2);


#endif
